var nav = document.querySelector("nav");
var flexs = document.querySelectorAll("nav ul li a");
var li1 =document.querySelector("#li1 a")
var li2 =document.querySelector("#li2 a")
var li3 =document.querySelector("#li3 a")
var li4 =document.querySelector("#li4 a")
var li5 =document.querySelector("#li5 a")
window.onscroll = function(){
    if( document.documentElement.scrollTop > 782){
        nav.className = "navbar navbar-expand-lg sticky";

    }else{
        nav.className = "navbar navbar-expand-lg";
    }



};


for(var i =0;i<flexs.length ;i++){
    flexs[i].onclick = linem;
}


function linem(){
    for (var i = 0 ;i < flexs.length; i++){
        if(flexs[i] === this){
            flexs[i].classList.add("active")
        }else {
            flexs[i].classList.remove("active");
        }
    }
}

console.log(document.documentElement.scrollTop);

